// AFAppDotNetAPIClient.h
//
// Copyright (c) 2012 Mattt Thompson (http://mattt.me/)
// 
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#import <Foundation/Foundation.h>
#import "AFHTTPSessionManager.h"
#import "KVModel.h"
#import "ProductDetailModel.h"
#import "UserModel.h"
#import "carDetailModel.h"

#define WEAPPHTTPMANAGER (WeAppHttpManager *)[WeAppHttpManager sharedClient]

@interface WeAppHttpManager : AFHTTPSessionManager

+ (instancetype)sharedClient;

-(void)getHttpMethordWithParameter:(NSDictionary *)parameter doneBlock:(void (^)(NSArray *posts, NSError *error))block;
//------------------------------------LB
/* LB获取验证码
 * http:// 192.168.0.113:8080/birdie/user/getVerifyCode
 */
- (void)getVerifyCodePath:(NSString *)path WithParameter:(NSDictionary *)parameter WithDoneBlock:(void(^) (NSString *errCode,NSString *errMsg))block errorBlock:(void (^) (NSError *error))eBlock;
/* LB用户注册
 *http:// 192.168.0.113:8080/birdie/user/saveUser
 */
- (void)postSaveUserPath:(NSString *)path WithParameter:(NSDictionary *)parameter WithDoneBlock:(void(^) (NSString *errCode,NSString *errMsg,UserModel *usermodle))block errorBlock:(void (^) (NSError *error))eBlock;

/* LB用户登录
 * http:// 192.168.0.113:8080/birdie/user/login
 {
 userName:”admin”,
 passWord:”123465”
 }
 */
- (void)postUserLoginPath:(NSString *)path WithParameter:(NSDictionary *)parameter WithDoneBlock:(void(^) (NSString *errCode,NSString *errMsg,UserModel *usermodle))block errorBlock:(void (^) (NSError *error))eBlock;


//二手车列表
//http:// 192.168.0.113:8080/birdie/car/findList?pageIndex=0&pageSize=5
- (void)getFindlist:(NSString *)path WithDoneBlock:(void(^) (NSArray *carlist))block errorBlock:(void (^) (NSError *error))eBlock;
//11.获取汽车详情
//¬	请求地址
//http://localhost:8080/birdie/car/get?id=6a817ec3-4057-4bdf-b00f-574c0661393c
//请求方式
//Get、POST
//¬	请求示例
//http://localhost:8080/birdie/car/get?id=6a817ec3-4057-4bdf-b00f-574c0661393c
//
//¬	请求参数说明
- (void)getCarDetailInfo:(NSString *)path WithDoneBlock:(void(^) (carDetailModel *model))block errorBlock:(void (^) (NSError *error))eBlock;



//------------------------------------
/* 首页
 *http://192.168.0.200:8080/Micro_application/service/apply/getApplyByThemeANDLable
 */

-(void)getHomeDataPath:(NSString *)path WithDoneBlock:(void(^) (NSString *App_Html_BannerString, NSArray *App_BannerArr, NSArray *App_Circle_BannerArr, NSArray *Recommend_BrandsArr))block errorBlock:(void (^) (NSError *error))eBlock;

/* 推荐商品列表
 *
 */
- (void)getRecommentProductListPath:(NSString *)path WithDoneBlock:(void(^) (NSArray *themeList))block errorBlock:(void (^) (NSError *error))eBlock;

/* 搜索
 * http://konvy.dongshihuafeng.com/app/search.php
 */
- (void)getSearchResultListPath:(NSString *)path WithDoneBlock:(void(^) (NSArray *brandListArr,NSArray *categoryListArr,NSArray *efficacysListArr))block errorBlock:(void (^) (NSError *error))eBlock;

/* 获取商品详细信息
 * 说明：返回商品详细信息
 * 获取地址：http://konvy.dongshihuafeng.com/app/team.php
 * 获取方式：http get
 */
- (void)getProductDetailPath:(NSString *)path WithDoneBlock:(void(^) (ProductDetailModel *productDetailModel))block errorBlock:(void (^) (NSError *error))eBlock;

/* 用户注册
 * http://konvy.dongshihuafeng.com/app/signup.php
 */
- (void)postUserRegisterPath:(NSString *)path WithParameter:(NSDictionary *)parameter WithDoneBlock:(void(^) (NSString *result,NSString *msg))block errorBlock:(void (^) (NSError *error))eBlock;


/* 密码重置
 * http://192.168.0.200:8080/Micro_application/service/user/resetPassword
 */
- (void)postResetPasswordPath:(NSString *)path WithParameter:(NSDictionary *)parameter WithDoneBlock:(void(^) (NSString * errCode,NSString * errMsg ))block errorBlock:(void (^) (NSError *error))eBlock;
/* 用户收藏列表
 * http://192.168.0.200:8080/Micro_application/service/apply/getApplyByuserId?userId=e23e5c98-0308-40f9-9464-0bb620e463af
 */
 - (void)getUserCollectionsPath:(NSString *)path WithDoneBlock:(void(^) (NSArray *UserCollections))block errorBlock:(void (^) (NSError *error))eBlock;

/* 按时间排序
 * http://localhost:8080/Micro_application/service/apply/getDescCreateTime?pageIndex=0&pageSize=20
 */
- (void)getDescCreateTimePath:(NSString *)path WithDoneBlock:(void(^) (NSArray *DescCreateTimeArray))block errorBlock:(void (^) (NSError *error))eBlock;

/*根据访问量排序
 *http://localhost:8080/Micro_application/service/apply/getDescNum?pageIndex=0&pageSize=20
 */
- (void)getDescNumPath:(NSString *)path WithDoneBlock:(void(^) (NSArray *DescNumArray))block errorBlock:(void (^) (NSError *error))eBlock;

/* 应用详情
 * http://192.168.0.200:8080/Micro_application/service/apply/get?userId=98efc07e-8719-4dba-9c2b-f2e539b68217&applyId=6a78aa15-8d05-40db-ab2b-a4480c6ccf62
 */
- (void)getApplyDetailInfoPath:(NSString *)path WithDoneBlock:(void(^) (KVModel *detailModel))block errorBlock:(void (^) (NSError *error))eBlock;

/* 用户评论列表
 * http://192.168.0.200:8080/Micro_application/service/comments/getCommentsByapplyId?applyVersionId=e67bbc39-6ad5-4f1f-b504-4d46e28051db&applyId=cc35c33e-a373-4ecf-85e3-1c7bb503e4ac
 */
- (void)getCommentsListPath:(NSString *)path WithDoneBlock:(void(^) (NSArray *allCommentsList))block errorBlock:(void (^) (NSError *error))eBlock;

/* 用户添加收藏接口
 * http://192.168.0.200:8080/Micro_application/service/collection/add
 */
- (void)postAddCollectionPath:(NSString *)path WithParameter:(NSDictionary *)parameter WithDoneBlock:(void(^) (NSString *errorCode))block errorBlock:(void (^) (NSError *error))eBlock;

/* 用户取消收藏
 * http://192.168.0.200:8080/Micro_application/service/collection/del?userId=98efc07e-8719-4dba-9c2b-f2e539b68217&applyId=6a78aa15-8d05-40db-ab2b-a4480c6ccf62
 */
- (void)getDeleateCollectionPath:(NSString *)path WithParameter:(NSDictionary *)parameter WithDoneBlock:(void(^) (NSString *errorCode))block errorBlock:(void (^) (NSError *error))eBlock;

/* 分类列表
 * http://192.168.0.200:8080/Micro_application/service/theme/getThemeALL
 */
- (void)getThemeAllPath:(NSString *)path WithDoneBlock:(void(^) (NSArray *themeList))block errorBlock:(void (^) (NSError *error))eBlock;

/* 获取app信息
 * http://konvy.dongshihuafeng.com/app/sessionid.php
 */
- (void)getVersionPath:(NSString *)path WithDoneBlock:(void(^) (ApplyVersionModel *model))block errorBlock:(void (^) (NSError *error))eBlock;

/* 添加评论 POST
 * http://192.168.0.200:8080/Micro_application/service/comments/add
 */
- (void)postCommentsPath:(NSString *)path WithParameter:(NSDictionary *)parameter WithDoneBlock:(void(^) (NSString *errorCode))block errorBlock:(void (^) (NSError *error))eBlock;

/* 播放视频
 *
 */
- (void)PlayVideoAction:(NSString *)path WithDoneBlock:(void(^) (NSURL *playUrl))block errorBlock:(void (^) (NSError *error))eBlock;

@end
